package com.bloveoa.zkkd.doman;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Table(name = "t_out_token")
@Data
@Accessors(chain = true)
@DynamicInsert
@DynamicUpdate
@Entity
@ApiModel(value = "OutTokenModel", description = "转币信息")
public class OutTokenModel implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", insertable = false, nullable = false)
    private Integer id;

    @ApiModelProperty(value = "交易hash", name = "txHash", example = "0x09998a2d0da7a3fd08029e011f5e0df078a13ab16a07a5873976d6c5ac7cbf1b")
    @Column(name = "tx_hash",unique = true,length = 66)
    private String txHash;

    @ApiModelProperty(value = "转出token 的hash", name = "tokenTxHash", example = "0x09998a2d0da7a3fd08029e011f5e0df078a13ab16a07a5873976d6c5ac7cbf1b")
    @Column(name = "token_tx_hash",unique = true,length = 66)
    private String tokenTxHash;

    @ApiModelProperty(value = "转入eth数量", name = "inEthNum", example = "0.001")
    @Column(name = "in_eth_num")
    private BigDecimal inEthNum;

    @ApiModelProperty(value = "转入eth数量,0 未转入，1已转入，2 转入数量不足", name = "ethStatus", example = "0")
    @Column(name = "eth_status")
    private Integer ethStatus;

    @ApiModelProperty(value = "转入eth成功的时间", name = "inEthTime", example = "")
    @Column(name = "in_eth_time")
    private Date inEthTime;



    @ApiModelProperty(value = "转出token数量", name = "outTokenNum", example = "1")
    @Column(name = "out_token_num")
    private BigDecimal outTokenNum;

    @ApiModelProperty(value = "转出token的状态", name = "tokenStatus", example = "1")
    @Column(name = "token_status")
    private Integer tokenStatus;

    @ApiModelProperty(value = "转出token的时间", name = "outTokenTime", example = "")
    @Column(name = "out_token_time")
    private Date outTokenTime;


    @ApiModelProperty(value = "转出token到的地址", name = "address", example = "")
    @Column(name = "address")
    private String address;

    @ApiModelProperty(value = "提交的时间", name = "createTime", example = "")
    @Column(name = "create_time")
    private Date createTime;
    @Column(name = "flag_delete")
    private Boolean flagDelete;

}
